/**
 *Copyright (c) 2024 watereyes
 * workflow is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.workflow.baseConfig.mapper;

import com.koron.workflow.baseConfig.bean.DepartmentStaffBean;
import com.koron.workflow.baseConfig.bean.PostBean;
import com.koron.workflow.baseConfig.bean.PostStaffRelBean;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author qingfeng
 * @description: TODO
 * @date 2020/4/13 11:40
 */
public interface PostMapper {

    List<PostBean> queryForList(@Param("name") String name,@Param("page") Integer page,
                                @Param("pageSize") Integer pageSize);

    int countForList(@Param("name") String name);

    int insert(PostBean post);

    int update(PostBean post);

    int delete(@Param("id") String id);

    PostBean queryByCode(@Param("code") String code);

    PostBean queryForObject(@Param("id") String id);

    /**
     * 查询岗位所属用户
     * @param postId
     * @param departmentName
     * @param staffName
     * @return
     */
    List<DepartmentStaffBean> queryPostStaff(@Param("postId") String postId,@Param("departmentName") String departmentName,@Param("staffName") String staffName);

    /**
     * 删除岗位用户关系
     * @param id
     * @return
     */
    int deletePostStaffRel(@Param("id") String id,@Param("postId") String postId);

    /**
     * 更新岗位用户关系
     * @param list
     * @return
     */
    int updatePostStaffRel(List<PostStaffRelBean> list);
}
